@extends('app')
@section('content')

<div class="container-fluid">
    <div class="row-fluid">
        <div class="span12">
            <div class="tabbable" id="tabs-876069">
                <ul class="nav nav-tabs">
                    <li class="active">
                        <a href="{{ url('/admin/enterprise/examinations')}}">试卷管理</a>
                    </li>
                    <li>
                        <a href="{{ url('/admin/enterprise/examinations/create')}}">添加</a>
                    </li>
                </ul>
                <div class="panel panel-default mt20">
                    <div class="table-responsive panel-body">
                        <table class="table table-hover">
                    <!--列表开始-->
                            <thead>
                              <tr>
                                <th>编号</th>
                                <th>名称</th>
                                <th>最低分</th>
                                <th>所属企业</th>
                                <th>考试时间</th>
                                <th>创建时间</th>
                                <th>操作</th>
                              </tr>
                            </thead>
                            <tbody>
                            @foreach($examinations as $res)

                                <tr id="news_{{ $res->id }}">
                                  <td>{{ $res->id }}</td>
                                  <td>
                                    <span>
                                      <a href="{{ url('/admin/enterprise/examinations/'.$res->id.'/edit') }}">{{ $res->name }}</a>
                                    </span>
                                  </td>
                                  <td>
                                    <span style="">
                                      {{ $res->score_limit }}
                                    </span>
                                  </td>
                                  <td>
                                      <span style="color: #2ECC71;" >
                                        @if (count($res->companyInfo) > 0)
                                          {!! $res->companyInfo->name !!}
                                        @else
                                          系统试卷
                                        @endif
                                      </span>
                                  </td>
                                  <td>
                                      <span class=" " style="">
                                        {{ $res->times }} 分钟
                                      </span>
                                  </td>
                                  <td>
                                      <span>
                                        {{  $res->created_at  }}
                                      </span>
                                  </td>
                                  <td>
                                    <a href="{{ url('/admin/enterprise/examinations/'.$res->id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                    <a href="javascript:void(0);" onclick="delete_one('/admin/enterprise/examinations/{{$res->id}}','{{$res->id}}','{{ csrf_token() }}', 'id')"><i class="glyphicon glyphicon-remove-sign"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                  </td>
                                </tr>
                            @endforeach
                            </tbody>
                          </table>
                        </div>
                        <div>{!! $examinations->render() !!} </div>
                    </div>
                    <!--列表结束-->
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
  // 鼠标滑过出现提示
  $(function () {
    $('[data-toggle="tooltip"]').tooltip();

  })
</script>
@endsection
